Rich Text Format Help

by Jim Brossman

jbross@sisna.com


Home

TCP/IP Tutorial

Rich Text Format Help

Creating Graphics for Games

Automatic Menu

Humble CAD Viewer

Demo: Aligning Numbers

Thoughts On Cross-Platform Help

Submission Guildlines

Newsletter Help

Index

Editor's Note: In addition to RTFHelp.bas provided by Jim, look in the zip archive for WindowHelp.bas, a smaller but similar demo application which shows how to provide RTF-formatted help in limited, focused installments.


Rich Text Format Help

On a large program I wrote, I wanted to include a manual as part of the help menu. Originally I wrote it using Tom Nally's Liberty Basic Simple Help from the Newsletter Issue 103.

It worked really well, looked professional and was fairly easy to implement. But when I saw John Davidson's Rich Text Format Read Me, RtfReadMe.bas, I got to thinking how nice it would look if my manual was done in Rich Text using the font of my choice rather that plain Jane courier new. The RTF format allows a lot more detail and emphasis to be done.

So with that in mind, I converted my original manual display to a Rich Text Format Help which is the basis of this program. (See RTFHelp.zip in the zip archive for NL115---Ed.)

Basically, you need a help file for each topic you want listed in the combo box above. The program is written so that each file is named help1.rtf, help2.rtf, help3.rtf etc.

Fig 1 - "Screenshot of Rich Text Format Help"

The array HelpTitle$ contains the topic string that appears in the combo box and the array HelpFileName$ contains the help file names. I suppose you could use a single array with two dimensions but it seemed easier to me to control with two arrays.

If the help file is large, a scroll bar will appear along the right side.

Note that my original program was written with the fact that some users may still be using 640 x 480 screen resolutions. So you will find a small section at the beginning of the GUI section that will set the WindowHeight based on the DisplayHeight. The size variable is used to place the bitmap buttons in relation to the WindowHeight.

The other nice feature in this program is the ability to print each help topic by clicking on the printer icon. This section uses the PrinterDialog and the Run command with the following line:

run "write.exe "+chr$(34)+HelpFile2Open$+chr$(34)+" /p",hide 

This line tells the program to run write.exe (WordPad) with an extra set of quote marks around the file (chr$(34)) so that long filenames with spaces work and the /p as the print switch and keep the wordpad window hidden with the ,hide.

I wrote all the help files with Word and saved in the rtf format. I then opened each file in WordPad and opened the page setup and made sure the top and left side margin was set to .5 inches. I then saved the file again from WordPad. If the margin is too small, WordPad will not print the extreme left or top of the file. I also added a blank line at the bottom of the document as it adds a more finished look when displayed in the program.

Unlike Tom's original program, this version does not require you to type at least one space on each empty line

Jim Brossman jbross@sisna.com


Home

TCP/IP Tutorial

Rich Text Format Help

Creating Graphics for Games

Automatic Menu

Humble CAD Viewer

Demo: Aligning Numbers

Thoughts On Cross-Platform Help

Submission Guildlines

Newsletter Help

Index